{% extends "web/base.html" %}
{% block title %}Account List{% endblock %}
{% block content %}
    <h1>Account List for book {{book.name}}</h1>
    <table>
	<thead>
	<tr><th>Name</th><th>Description</th><th>Category</th></tr>
	</thead>
    	{% for account in accounts %}
	<tr><td><a href="/accountShow?account={{account.key.urlsafe()}}">{{account.name}}</a></td><td>{{account.description}}</td><td>{{account.getCategoryName()}}</td></tr>
    	{% endfor %}
    </table>
    <form action="/accountCreate" method="post">
	<input type="hidden" name="book" value="{{book.key.urlsafe()}}" />
    	Name: <input type="text" name="name" /> <br/>
	Description: <input type="text" name="description" /> <br/>
	Category: <select name="categoryKey">
	{% for categoryKey in categories.keys() %}
	<option value="{{categoryKey}}">{{categories[categoryKey]}}</option>
	{% endfor %}
	</select> <br/>
    	<input type="submit" value="Save" />
    </form>
{% endblock %}
